﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;
using Core.Email;
using Utils;

namespace EmailService
{
    public class Emailer : IEmailer
    {
        public void SendSingleEmail(string to, string subject, string message)
        {
            Send(to, subject, message);
        }

        private static void Send(string to, string subject, string message)
        {
            SmtpClient smtpClient = new SmtpClient();
            MailMessage mailMessage = new MailMessage();
            mailMessage.IsBodyHtml = true;
            mailMessage.To.Add(to);
            mailMessage.Subject = subject;
            mailMessage.Body = message;
            smtpClient.Send(mailMessage);
        }
    }
}
